<template>
    <div class="container">
        <div class="btn-list">
            <div class="btn" v-for="item in btnList" :key="item.itemCode">
                <van-button type="default" @click="btnHandler(item.itemCode, item.title,item.isExamine)">{{ item.title }}</van-button>
            </div>
        </div>
    </div>
</template>

<script>
import { getAxios2 } from "@/utils/request2";
export default {
    data() {
        return {
            btnList: [],
        }
    },
    mounted() {
        this.getBtnList()
    },
    created(){

    },
    methods: {
        btnHandler(itemCode, title,isExamine) {
            localStorage.setItem('isExamine',isExamine)
            this.$router.push({ path: '/fgbm/detail', query: { itemCode, title } })
        },

        async getBtnList() {

            let axios2=await getAxios2()
             const data2 = await axios2.get('https://fgbm.zatsafety.com/app/study/treeDataList')
            //  const data2 = await axios2.get('http://192.168.138.22:8558/app/study/treeDataList')
            //  console.log(data2)
            this.btnList = data2.data
        }
    }
}
</script>

<style lang="less" scoped>
.container {
    .btn-list {
        width: 90%;
        height: 430px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin: 15px;
        background-color: #fff;
        border-radius: 10px;
        box-shadow: 0 0 5px #ccc;

        .btn {
            padding: 10px 15px;

            .van-button {
                width: 100%;
                background-color: #f8f8f8;
            }
        }
    }
}
</style>